package com.huluobo.report

import com.huluobo.lib_base.BaseRepo
import com.huluobo.lib_base.Res
import com.huluobo.lib_http.HttpType
import com.huluobo.lib_http.NetworkFactory
import com.huluobo.report.entity.ReportEntity
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
 *  Created by LC on 2025/3/15.
 */
class ReportRepo @Inject constructor() : BaseRepo() {
    private val apiService by lazy { NetworkFactory.factory(HttpType.TOKEN).create(ApiService::class.java) }

    fun getReports(): Flow<Res<ReportEntity>> {
        return apiService.getReports()
    }

    fun addReport(map: Map<String, String>): Flow<Res<Any>> {
        return apiService.addReport(mapToJson(map))
    }
}